const importFn = import.meta.glob('./**/*.vue', { eager: true })

export default {
  install(app) {
    Object.keys(importFn).forEach(key => {
      const componentName = key.replace(/\.\/(.*?)\/(.*?).vue/, '$1')
      app.component(componentName, importFn[key].default)
    })
  }
}
